package a.g.a;

import a.e.e;
import a.e.u;
import a.g.f;
import a.h.dc;
import a.h.jc;
import a.h.nc;
import a.h.z;
import a.j.g;
import a.j.pg;

import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

public abstract class a
  extends f
{
  private e d;
  protected u h = new u();
  public static final byte q = 0;
  public static final byte r = 1;
  private byte s = 0;
  private URL t;
  protected static final String u = "VIEWPORT";
  protected static final String v = "SIZE";
  protected static final String w = "USE_ORIGINAL_SIZE";
  protected static final String x = "USE_CUSTOM_WIDTH";
  protected static final String y = "USE_CUSTOM_HEIGHT";
  protected static final String z = "CUSTOM_WIDTH";
  protected static final String A = "CUSTOM_HEIGHT";
  protected static final String B = "MARGIN";
  protected static final String C = "SCALING_FACTOR";
  protected static final String D = "CLIP_REGION";
  protected static final String E = "CLIP_VIEW";
  protected static final String F = "CLIP_GRAPH";
  protected static final String G = "TILING";
  protected static final String H = "TILING_ACTIVE";
  protected static final String I = "TILE_COLUMN_COUNT";
  protected static final String J = "TILE_ROW_COUNT";
  protected static final String K = "GENERATE_HTML_TABLE";
  public static boolean L;
  public static boolean M;
  
  protected a(String paramString1, String paramString2, String paramString3)
  {
    super(paramString1, paramString2, paramString3);
  }
  
  protected void a(byte paramByte)
  {
    this.s = paramByte;
  }
  
  protected void a(pg parampg1, pg parampg2)
  {
    r();
    this.h.a(parampg1.a());
    this.h.b(parampg2);
    this.h.a(parampg1);
  }
  
  protected void b(dc paramdc)
  {
    boolean bool2 = M;
    boolean bool1 = L;
    z localz = new z(paramdc);
    paramdc.a("SIZE", new String[] { "USE_ORIGINAL_SIZE", "USE_CUSTOM_WIDTH", "USE_CUSTOM_HEIGHT" }, this.h.d());
    paramdc.a("CUSTOM_WIDTH", this.h.e()).a(nc.y, new Integer(1));
    localz.a("SIZE", "USE_CUSTOM_WIDTH", "CUSTOM_WIDTH");
    paramdc.a("CUSTOM_HEIGHT", this.h.f()).a(nc.y, new Integer(1));
    localz.a("SIZE", "USE_CUSTOM_HEIGHT", "CUSTOM_HEIGHT");
    paramdc.a("MARGIN", this.h.b());
    paramdc.a("CLIP_REGION", new String[] { "CLIP_GRAPH", "CLIP_VIEW" }, this.h.c());
    paramdc.a("SCALING_FACTOR", this.h.a()).a(jc.y, new Double(1.0E-007D));
    if ((bool2) || (bool1))
    {
      if (!bool2) {}
      q.n = !q.n;
    }
    if (bool2) {
      q.o = !q.o;
    }
  }
  
  protected void c(dc paramdc)
  {
    z localz = new z(paramdc);
    paramdc.a("TILING_ACTIVE", false);
    paramdc.a("TILE_COLUMN_COUNT", 2).a(nc.y, new Integer(0));
    paramdc.a("TILE_ROW_COUNT", 2).a(nc.y, new Integer(0));
    paramdc.a("GENERATE_HTML_TABLE", false);
    localz.a("TILING_ACTIVE", Boolean.TRUE, "TILE_COLUMN_COUNT");
    localz.a("TILING_ACTIVE", Boolean.TRUE, "TILE_ROW_COUNT");
    localz.a("TILING_ACTIVE", Boolean.TRUE, "GENERATE_HTML_TABLE");
  }
  
  protected void r()
  {
    boolean bool2 = M;
    boolean bool1 = L;
    dc localdc = i();
    if (!bool2) {
      if (localdc.j("SIZE").equals("USE_ORIGINAL_SIZE"))
      {
        this.h.b(u.c);
        if (bool2) {
          break label190;
        }
        if (!bool1) {
          break label113;
        }
      }
    }
    if (!bool2) {
      if (localdc.j("SIZE").equals("USE_CUSTOM_WIDTH"))
      {
        this.h.b(u.d);
        if (bool2) {
          break label190;
        }
        if (!bool1) {
          break label113;
        }
      }
    }
    if (!bool2)
    {
      if (localdc.j("SIZE").equals("USE_CUSTOM_HEIGHT")) {
        this.h.b(u.e);
      }
      label113:
      this.h.b(Math.max(localdc.e("CUSTOM_WIDTH"), 1));
      this.h.c(Math.max(localdc.e("CUSTOM_HEIGHT"), 1));
      this.h.a(localdc.e("MARGIN"));
      this.h.a(Math.max(localdc.f("SCALING_FACTOR"), 1.0E-007D));
    }
    label190:
    if (!bool2) {
      if (localdc.j("CLIP_REGION").equals("CLIP_GRAPH")) {
        this.h.a(u.a);
      }
    }
    if ((bool2) || ((bool1) && (localdc.j("CLIP_REGION").equals("CLIP_VIEW")))) {
      this.h.a(u.b);
    }
  }
  
  public byte s()
  {
    return this.s;
  }
  
  public void a(URL paramURL)
  {
    this.t = paramURL;
  }
  
  public URL t()
  {
    return this.t;
  }
  
  protected abstract e u();
  
  public e v()
  {
    if (!M) {
      if (this.d == null) {
        this.d = u();
      }
    }
    return this.d;
  }
  
  protected void a(e parame)
  {
    this.d = parame;
  }
  
  protected void n()
  {
    boolean bool = M;
    try
    {
      g localg = e();
      URL localURL = t();
      if (!bool) {
        if (localURL == null) {
          localURL = localg.cb();
        }
      }
      if (localURL == null) {
        throw new IllegalStateException("No URL given");
      }
      if (!bool) {}
      switch (s())
      {
      case 1: 
        v().a(e(), localURL);
        if (!L) {
          break;
        }
      case 0: 
        try
        {
          File localFile = new File(new URI(localURL.toString()));
          str = localFile.getCanonicalPath();
          v().a(e(), str);
          e().gb();
        }
        catch (URISyntaxException localURISyntaxException)
        {
          String str = localURL.getFile();
          v().a(e(), str);
          e().gb();
        }
      }
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      if (a(localIllegalArgumentException)) {
        n.b(localIllegalArgumentException);
      }
    }
    catch (IOException localIOException)
    {
      if (a(localIOException)) {
        n.b(localIOException);
      }
    }
    catch (OutOfMemoryError localOutOfMemoryError)
    {
      if (a(localOutOfMemoryError)) {
        n.a(localOutOfMemoryError);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.g.a.a

 * JD-Core Version:    0.7.0.1

 */